home *** CD-ROM | disk | FTP | other *** search
/ Minami 83 / MINAMI83.iso / Extra / winamp532.exe / $R0 / Winamp Modern / scripts / mute.maki (.txt) < prev    next >
Winamp Compiled Maki Script  |  2005-09-15  |  4KB  |  128 lines

  1. /* Note: a decompiler is no invitation to steal code.
  2.    Please respect the the copyright */
  3.  
  4. #include "std.mi"
  5. Global Group Group16;
  6. Global ToggleButton ToggleButton17;
  7. Global ToggleButton ToggleButton18;
  8. Global Timer Timer19;
  9. Global Text Text20;
  10. Global Float Float21;
  11. Global Boolean Boolean22;
  12. Global Boolean Boolean23;
  13. Global Layer Layer24;
  14. Global Timer Timer25;
  15.  
  16.  
  17. System.onScriptLoaded()
  18. {
  19. Boolean22 = System.getPrivateInt(( "winamp5"), ( "muted"), 0);
  20. Float21 = System.getPrivateInt(( "winamp5"), ( "old_volume"), 0);
  21. Group16 = System.getScriptGroup();
  22. ToggleButton17 = Group16.findObject(( "mute"));
  23. ToggleButton17.setActivated(Boolean22);
  24. Timer25 = ( new Timer);
  25. Timer25.setDelay(5);
  26. Timer25.start();
  27. Text20 = Group16.findObject(( "songticker"));
  28. Layer24 = Group16.findObject(( "volumebar"));
  29. Layer24.setXmlParam(( "w"), System.integerToString(( ( ( System.getVolume() / 255) * 70) + 5)));
  30. Timer19 = ( new Timer);
  31. Timer19.setDelay(1000);
  32. if(Boolean22) {
  33. Timer19.start();
  34. Text20.setText(( "Mute\ ON"));
  35. }
  36. Boolean23 = 0;
  37. return Null;
  38. }
  39.  
  40. System.onScriptUnloading()
  41. {
  42. System.setPrivateInt(( "winamp5"), ( "muted"), Boolean22);
  43. System.setPrivateInt(( "winamp5"), ( "old_volume"), Float21);
  44. delete Timer25;
  45. return Null;
  46. }
  47.  
  48. Timer25.onTimer()
  49. {
  50. ToggleButton18 = System.getContainer(( "main")).getLayout(( "shade")).findObject(( "shademute"));
  51. if(( ToggleButton18 != Null)) {
  52. ToggleButton18.setActivated(Boolean22);
  53. Timer25.stop();
  54. }
  55. return Null;
  56. }
  57.  
  58. Timer19.onTimer()
  59. {
  60. Text20.setText(( ""));
  61. Timer19.stop();
  62. return Null;
  63. }
  64.  
  65. ToggleButton17.onLeftClick()
  66. {
  67. Boolean23 = 1;
  68. if(( ! Boolean22)) {
  69. Float21 = System.getVolume();
  70. System.setVolume(0);
  71. Boolean22 = 1;
  72. Timer19.start();
  73. Text20.setText(( "Mute\ ON"));
  74. ToggleButton18.setActivated(1);
  75. } else {
  76. System.setVolume(Float21);
  77. Boolean22 = 0;
  78. Timer19.start();
  79. Text20.setText(( "Mute\ OFF"));
  80. ToggleButton18.setActivated(0);
  81. }
  82. return Null;
  83. }
  84.  
  85. ToggleButton18.onLeftClick()
  86. {
  87. Boolean23 = 1;
  88. if(( ! Boolean22)) {
  89. Float21 = System.getVolume();
  90. System.setVolume(0);
  91. Boolean22 = 1;
  92. Timer19.start();
  93. Text20.setText(( "Mute\ ON"));
  94. ToggleButton17.setActivated(1);
  95. } else {
  96. System.setVolume(Float21);
  97. Boolean22 = 0;
  98. Timer19.start();
  99. Text20.setText(( "Mute\ OFF"));
  100. ToggleButton17.setActivated(0);
  101. }
  102. return Null;
  103. }
  104.  
  105. System.onScriptUnloading()
  106. {
  107. delete Timer19;
  108. return Null;
  109. }
  110.  
  111. System.onVolumeChanged(int newvol)
  112. {
  113. Layer24.setXmlParam(( "w"), System.integerToString(( ( ( newvol / 255) * 70) + 5)));
  114. if(( ! Boolean23)) {
  115. Timer19.start();
  116. Text20.setText(( ( ( "Volume\:") + System.integerToString(( newvol / ( 2.54999995231628)))) + ( "\%")));
  117. if(Boolean22) {
  118. ToggleButton17.setActivated(0);
  119. ToggleButton18.setActivated(0);
  120. Boolean22 = 0;
  121. }
  122. }
  123. Boolean23 = 0;
  124. return Null;
  125. }
  126.  
  127.  
  128.